<?php

namespace App\Admin\Actions\Grid\Tools;

use App\Admin\Forms\CreateOrder as AppCreateOrder;
use Dcat\Admin\Widgets\Modal;
use Dcat\Admin\Grid\RowAction;

class CreateOrder extends RowAction
{
    protected $title = '<div class="pull-right" data-responsive-table-toolbar="grid-table">
<a href="javascript:void(0)" class="btn btn-primary btn-outline"><i class="feather icon-plus"></i><span class="d-none d-sm-inline">&nbsp;&nbsp;新增</span>
</a>
</div>';

    public function render()
    {
        // 实例化表单类并传递自定义参数
        $form = AppCreateOrder::make()->payload(['id' => $this->getKey()]);

        return Modal::make()
            ->lg()
            ->title('添加订单')
            ->body($form)
            ->button($this->title);
    }
}
